// 导入类
import Model from '@/utils/http.js'
// const baseUrl = 'https://cnodejs.org/api/v2'
//继承类的方法
class Cnode extends Model {

	constructor(baseUrl) {
		super(baseUrl)
		this.baseUrl = baseUrl
	}

	// 注册/登录
	// 发送验证码
	sendCodeBtn(phone) {
		return this.get({
			url: '/app/v1/customer/login/sms/code',
			data: {
				"phone": phone
			}
		})
	}
	// 登录
	login(params) {
		return this.post({
			url: '/app/v1/customer/login/sms',
			data: params
		})
	}
	// 首页banner
	bannerList() {
		return this.get({
			url: '/shenye/advertisement/config/index/banner/list',
		})
	}
    //获取神椰广告轮播图列表
    bannerListNew(advertisePageType) {
    	return this.get({
    		url: `/shenye/advertisement/config/v2/banner/list/${advertisePageType}`,
    	})
    }
    //神椰广告链接配置列表
    advertisementList(advertisePageType) {
    	return this.get({
    		url: `/shenye/advertisement/config/v2/link/list/${advertisePageType}`,
    	})
    }
    //收藏店铺
    collect(data) {
    	return this.post({
    		url: `/merchant/shop/collect`,
            data:data,
    	})
    }
    // 取消收藏店铺
    unCollect(params) {
    	return this.put({
    		url: '/merchant/shop/collect/unCollect',
    		data: params
    	})
    }
	// 查询用户实名信息
	getRealNameInfo() {
		return this.get({
			url: '/personal/center/real/name'
		})
	}
	// 实名认证
	setRealNameInfo(params) {
		return this.put({
			url: '/personal/center/real/name',
			data: params
		})
	}
	// 精选yo卡列表
	getYoList(params) {
		return this.get({
			url: '/equityManager/equityCard/getYoList',
			data: params
		})
	}
	// 发售日历卡列表
	getSaleCalendarList(params) {
		return this.get({
			url: '/equityManager/equityCard/getSaleCalendarList',
			data: params
		})
	}
	// 发售日历
	getSaleCalendar(params) {
		return this.get({
			url: '/equityManager/equityCard/getSaleCalendar'
		})
	}
	// 查询权益卡详情
	getEquityCardDetail(id) {
		return this.get({
			url: `/equityManager/equityCard/detail/${id}`
		})
	}
	// 数字权益卡店铺
	getCustomerCardDetail(id) {
		return this.get({
			url: `/equityManager/equityCard/customer/card/detail/${id}`
		})
	}
	// 关注-取消关注
	setAttention(params) {
		return this.put({
			url: '/equityManager/equityCard/attention',
			data: params
		})
	}
	// 我的关注列表
	getAttentionList(params) {
		return this.get({
			url: '/equityManager/equityCard/attention/list',
			data: params
		})
	}
	// 预约权益卡
	setSubscribe(id) {
		return this.post({
			url: `/equityManager/equityCard/subscribe/${id}`
		})
	}
	// 查询中签用户
	queryCustomer(issueTimeId) {
		return this.get({
			url: `/equityManager/equityCard/customer/${issueTimeId}`
		})
	}
	// 查询白名单用户
	queryWhiteCustomer(issueId) {
		return this.get({
			url: `/equityManager/equityCard/white/customer/${issueId}`
		})
	}
	// 用户支付
	payOrder(params) {
		return this.post({
			url: '/equity/order/pay',
			type:1,
			data: params
		})
	}
	// 查询支付页面信息
	getPayDetails(id) {
		return this.get({
			url: `/equity/order/pay/${id}`
		})
	}
	// 微信公众号分享
	getWxshare(url) {
		return this.get({
			url: '/common/v1/wx/share',
			data: {
				url: url
			}
		})
	}
	// 权益卡订单列表
	getOrderList(params) {
		return this.get({
			url: '/equity/order/list',
			data: params
		})
	}
	// 取消订单
	setOrderCancel(id) {
		return this.put({
			url: `/equity/order/cancel/${id}`
		})
	}
	// 用户资料信息
	getCustomer() {
		return this.get({
			url: '/mine/center/customer'
		})
	}
	// 用户等级信息
	getCustomerLevel() {
		return this.get({
			url: '/mine/center/customer/level'
		})
	}
	// 用户成长值列表
	getGrowthList(params) {
		return this.get({
			url: '/mine/center/growth/list',
			data: params
		})
	}
	// 用户等级列表
	getLevelList() {
		return this.get({
			url: '/mine/center/level/list'
		})
	}
	// 未读消息
	getUnreadHas() {
		return this.get({
			url: '/equityManager/equityCard/unread/has'
		})
	}
	// 用户消息列表
	getEquityCardList(params) {
		return this.get({
			url: '/equityManager/equityCard/list',
			data: params
		})
	}
	// 我的卡包券
	getCustomerCardList(params) {
		return this.get({
			url: '/equityManager/equityCard/getCustomerCardList',
            data:params
		})
	}
	// 区块链查询
	getCustomerChainDetail(voucher) {
		return this.get({
			url: '/customer/chain/detail',
			data: {
				voucher: voucher
			}
		})
	}
	// 消费打卡记录列表
	getConsumerList(params) {
		return this.get({
			url: '/equityManager/equityCard/consumer/list',
			data: params
		})
	}
	// 消费记录详情
	getConsumerDetail(id) {
		return this.get({
			url: `/equityManager/equityCard/consumer/detail/${id}`
		})
	}
	// 消费记录总计
	getConsumerCount(params) {
		return this.get({
			url: '/equityManager/equityCard/consumer/count',
			data: params
		})
	}
	// 链上信息
	getChainDetail(id) {
		return this.get({
			url: `/equityManager/equityCard/chain/detail/${id}`
		})
	}
	// 查询权益卡支付结果
	getPayResult(orderId) {
		return this.get({
			url: `/equity/order/pay/result/${orderId}`
		})
	}
	//查询商家权益核销结果
	verificationResult(data) {
		return this.post({
			url: `/equity/order/verification/result`,
			data
		})
	}
	// 获取token
	getH5Token(params) {
		return this.post({
			url: '/common/v1/token',
			data: params
		})
	}
	// 查询权益卡支付结果
	getH5Voucher() {
		return this.get({
			url: '/common/v1/voucher'
		})
	}
	// 查询待支付页面信息
	getWaitPay(orderId) {
		return this.get({
			url: `/equity/order/wait/pay/${orderId}` 
		})
	}
	// 预约抢购支付
	getRushPay(params) {
		return this.post({
			url: '/equity/order/rush/pay',
			type:1,
			data: params
		})
	}
	// 预约抢购取消订单
	putRushCancel(id) {
		return this.put({
			url: `/equity/order/rush/cancel/${id}`
		})
	}
	equityCardIsShelves(equityCardId) {
		return this.get({
			url: '/equityManager/equityCard/isShelves',
			data: {
				equityCardId: equityCardId
			}
		})
	}
	//盲盒（2022.9.21）
	// 奖池 抽奖排行
	luckDrawRankList(params) {
		return this.get({
			url: '/box/activity/luckDrawRankList',
			data: params
		})
	}
	// 奖池 我的排名信息
	myRanking(params) {
		return this.get({
			url: '/box/activity/myRanking',
			data: params
		})
	}
	// 历史开奖 历史活动
	getHisBoxActivityList(params) {
		return this.get({
			url: '/box/activity/getHisBoxActivityList',
			data: params
		})
	}
	// 历史开奖 历史盲盒活动奖池信息
	getHisBoxActivityJackpotList(params) {
		return this.get({
			url: '/box/activity/getHisBoxActivityJackpotList',
			data: params
		})
	}
	// 中奖名单
	getJackpotRecordList(params) {
		return this.get({
			url: '/box/activity/getJackpotRecordList',
			data: params
		})
	}
	// 奖池首页 奖池奖品
	homeJackpotPrizeList(params) {
		return this.get({
			url: '/box/activity/homeJackpotPrizeList',
			data: params
		})
	}
	// 奖池首页 邀请信息 （累计邀请、开启盲盒、总计签数）
	getBeeInvitationInfo(params) {
		return this.get({
			url: '/box/activity/getBeeInvitationInfo',
			data: params
		})
	}
	// 奖池首页
	getIndexJackpotInfo(params) {
		return this.get({
			url: '/box/activity/getIndexJackpotInfo',
			data: params
		})
	}
	// 奖池首页 当前盲盒活动奖池信息
	getCurrentBoxActivityJackpotList(params) {
		return this.get({
			url: '/box/activity/getCurrentBoxActivityJackpotList',
			data: params
		})
	}
	
	// 盲盒 9.22
	// H5 每日任务 邀请新用户 生成二维码
	getInviteQRCode() {
		return this.get({
			url: '/box/activity/inviteQRCode'
		})
	}
	// H5 玩法规则 活动图片列表
	getActivityPictureList(data) {
		return this.get({
			url: '/box/activity/activityPictureList',
			data
		})
	}
	// H5 邀请用户列表
	getReferrerCustomerList(params) {
		return this.get({
			url: '/box/activity/getReferrerCustomerList',
			data:params
		})
	}
	// H5 注册页面 获取推荐用户
	getReferrerCustomer(customerReferrerId) {
		return this.get({
			url: '/box/activity/getReferrerCustomer',
			data:{customerReferrerId:customerReferrerId}
		})
	}
	// H5 我的奖品 盲盒奖品
	getMyBoxPrizeList(params) {
		return this.get({
			url: '/box/activity/myBoxPrizeList',
			data:params
		})
	}
	// H5 我的奖品 奖池奖品
	getMyJackpotPrizeList(params) {
		return this.get({
			url: '/box/activity/myJackpotPrizeList',
			data:params
		})
	}
	// H5 盲盒奖品列表
	getPrizeList(params) {
		return this.get({
			url: '/box/activity/prizeList',
			data:params
		})
	}
	// H5 当前盲盒活动
	getCurrentBoxActivity(id) {
		return this.get({
			url: '/box/activity/getCurrentBoxActivity/' + id
		})
	}
	// H5 盲盒类型
	getBoxType(id) {
		return this.get({
			url: '/box/activity/type/' + id
		})
	}
	// H5 盲盒首页 
	// getIndexBoxInfo() {
	// 	return this.get({
	// 		url: '/box/activity/getIndexBoxInfo'
	// 	})
	// }
	// H5 盲盒购买价格信息
	getBoxActivityPrice(data) {
		return this.get({
			url: '/box/activity/getBoxActivityPrice',
			data
		})
	}
	// H5 盲盒购买价格列表
	getBoxActivityPriceList(data) {
		return this.get({
			url: '/box/activity/getBoxActivityPriceList',
			data
		})
	}
	// H5 盲盒奖品图片轮播
	getPrizeImgList(data) {
		return this.get({
			url: '/box/activity/prizeImgList',
			data
		})
	}
	// H5 盲盒首页 开奖信息
	// getIndexBoxInfo() {
	// 	return this.get({
	// 		url: '/box/activity/getIndexBoxInfo'
	// 	})
	// }
	getActivityPay(params) {
		return this.post({
			// url: '/box/activity/pay',
			url: '/box/order/pay',
			type:1,
			data:params
		})
	}
	// h5 盲盒任务列表
	getMissionList() {
		return this.get({
			url: '/box/activity/getMissionList',
			
		})
	}
	// h5 查询邀请用户排名
	getMyInvite() {
		return this.get({
			url: '/invite/customer/rank',
			
		})
	}
	// h5 邀新排行榜
	getInviteList() {
		return this.get({
			url: '/invite/rank/list',
			
		})
	}
	// h5 获取优惠数量
	getCouponNum() {
		return this.get({
			url: '/box/activity/getCouponNum',
			
		})
	}
	// 盲盒支付结果查询
	getBoxPayResult(orderId) {
		return this.post({
			url: `/box/activity/pay/result/${orderId}`,
		})
	}
	// 盲盒优惠券支付
	getActivityCouponPay(params) {
		return this.post({
			url: '/box/activity/coupon/pay',
			data:params
		})
	}
	// 活动规则
	getCurrentInviteActivity() {
		return this.get({
			url: '/box/activity/getCurrentInviteActivity'
		})
	}

	// 用户消息详情
	getMessageDetail(id) {
		return this.get({
			url: `/equityManager/equityCard/message/detail/${id}`
		})
	}

	// h5 公告列表 最新的5条
	getAnnouncementLimitList() {
		return this.get({
			url: '/mine/center/announcement/limit/list'
		})
	}
	//  h5 公告信息列表
	getAnnouncementList(params) {
		return this.get({
			url: '/mine/center/announcement/list',
			data:params
		})
	}
	//  公告信息详情
	getAnnouncementGetInfo(id) {
		return this.get({
			url: `/mine/center/announcement/getInfo/${id}`
		})
	}
	// 获取用户 coin信息
	getCoin() {
		return this.get({
			// url: '/mine/center/getCoin'
			url: '/mine/center/getIntegral'
		})
	}
	//  神椰coin明细列表
	getCoinList(params) {
		return this.get({
			url: '/mine/center/coin/list',
			data:params
		})
	}
	// 头像设置
	putSetAvatar(avatar) {
		return this.put({
			url: '/mine/center/set/avatar?avatar='+avatar,
		})
	}
	// 昵称设置
	putSetNickName(nickName) {
		return this.put({
			url: '/mine/center/set/nickName?nickName='+nickName,
		})
	}
	// 通用上传请求
	getCommonUpload(params) {
		return this.post({
			url: '/common/v1/upload',
			data:params
		})
	}
	// 查看编码
	getCardNoList(params) {
		return this.get({
			url: '/equityManager/equityCard/getCardNoList',
			data:params
		})
	}
	// 我的卡包券 排序保存
	putSetCardListSort(params) {
		return this.put({
			url: '/equityManager/equityCard/setCardListSort',
			data:params
		})
	}
    //我的卡包券 ID集合
    getCustomerCardIdList(params) {
    	return this.get({
    		url: '/equityManager/equityCard/getCustomerCardIdList',
			data:params
    	})
    }
    //查看历史权益码
    getHistoryCardNoList(params) {
    	return this.get({
    		url: '/equityManager/equityCard/getHistoryCardNoList',
            data:params
    	})
    }
    //权益卡权益
    getEquityCardEquity(params) {
    	return this.get({
    		url: '/equityManager/equityCard/getEquityCardEquity',
            data:params
    	})
    }
    //权益码库存判断
    getEquityCodeInventory(params) {
    	return this.get({
    		url: '/equityManager/equityCard/equityCodeInventory',
            data:params
    	})
    }
    //当前权益是否已激活
    getIsActivation(params) {
    	return this.get({
    		url: '/equityManager/equityCard/isActivation',
            data:params
    	})
    }
    //获取激活权益码
    getEquityCode(params) {
    	return this.get({
    		url: '/equityManager/equityCard/getEquityCode',
            data:params
    	})
    }
    //激活权益
    activateCoupons(params) {
    	return this.post({
    		url: `/equityManager/equityCard/activateCoupons?customerCardId=${params.customerCardId}&equityCardId=${params.equityCardId}`,
    	})
    }
    //查询好友信息
    getH5CustomerInfoByPhone(params) {
    	return this.get({
    		url: '/mine/center/getH5CustomerInfoByPhone',
            data:params
    	})
    }
    //查询权益卡转赠配置信息
    getDonationConfig(id) {
    	return this.get({
    		url: `/equity/card/donation/getDonationConfig/${id}`,
    	})
    }
    //h5转赠
    getDonation(params) {
    	return this.post({
    		url: '/equity/card/donation',
    		data:params
    	})
    }
    //查询转赠支付结果
    getDonationPayResult(id) {
    	return this.get({
    		url: `/equity/card/donation/pay/result/${id}`,
    	})
    }
    //h5手动取消转赠
    getCancelOrder(orderId) {
    	return this.post({
    		url: `/equity/card/donation/cancel/${orderId}`,
    	})
    }
	// 查询白名单抢购资格
	getWhiteQualification() {
		return this.get({
			url: '/equityManager/equityCard/white/qualification',
		})
	}
	// 权益卡转赠明细列表
	getDonationRecordList(params) {
		return this.get({
			url: '/equity/card/donation/record/list',
	        data:params
		})
	}
	
	// 获取 前端NFR记录按钮 1不显示 2显示
	getDonationShow(params) {
		return this.get({
			url: '/equity/card/donation/donationShow',
		})
	}
	// 获取验证码
	getLoginSmsCode() {
		return this.get({
			url: '/personal/center/captchaImage'

		})
	}
	// 获取银盛支付结果信息
	getYsResult(params) {
		return this.get({
			url: '/common/v1/ys/result',
			data:{'channelNo':params}
		})
	}
    // 获取用户 积分信息 (CoCo+通分)
    getIntegral() {
    	return this.get({
    		url: '/mine/center/getIntegral'
    	})
    }
    //查询兑换coco信息
    getIntegralCoco() {
    	return this.get({
    		url: '/integral/commodity/v1/coco'
    	})
    }
    //查询兑换coco详情
    getCocodetail(id) {
    	return this.get({
    		url: `/integral/commodity/v1/coco/detail/${id}`
    	})
    }
    //coco兑换
    integralCommodity(params) {
    	return this.put({
    		url: '/integral/commodity/v1/coco/change',
    		data: params
    	})
    }
    //我的卡包券 功能类型数量分类
    getCustomerCardFunctionType() {
    	return this.get({
    		url: `/equityManager/equityCard/getCustomerCardFunctionType`
    	})
    }
    //查看历史权益码 + 当前权益 数量
    getEquityNum() {
    	return this.get({
    		url: `/equityManager/equityCard/getEquityNum`
    	})
    }
    //查看历史权益码 （激活权益）
    getHistoryCardNoListByCustomer() {
    	return this.get({
    		url: `/equityManager/equityCard/getHistoryCardNoListByCustomer`
    	})
    }
    //当前权益
	getCurrentEquity() {
		return this.get({
			url: `/equityManager/equityCard/getCurrentEquity`
		})
	}
	
	// 获取版本信息
    getEditionDetail() {
    	return this.get({
    		url: `/common/v1/app/detail`
    	})
    }
	
	//用户协议详情
	getCustomerAgreementDetail(type) {
		return this.get({
			url: `/customer/agreement/detail/${type}`,
		})
	}
	
	// 首页-打卡活动列表
	configPunchActivityList(params) {
		return this.get({
			url: '/shenye/advertisement/config/punch/activity/list',
			data: params
		})
	}
    //打卡活动列表
    puncActivityhList(advertisePageType) {
    	return this.get({
    		url: `/shenye/advertisement/config/v2/punch/activity/list/${advertisePageType}`,
    	})
    }
    //NFR推荐列表 用户端首页
    getEquityCardSummaryList(params) {
    	return this.get({
    		url: `/equity/card/config/v1/getEquityCardSummaryList`,
            data: params,
    	})
    }
	// 查询奖池提示金额
	paradiseJackpotHint(punchActivityId) {
		return this.get({
			url: `/shenye/paradise/jackpot/hint/${punchActivityId}`,
		})
	}
	//下单购买
	paradiseBuy(params) {
		return this.post({
			// url: '/shenye/paradise/buy',
			url: '/paradise/order/pay',
			type:1,
			data: params
		})
	}
	// 查询超级到店详情
	paradiseShopPlatformDetail(params) {
		return this.get({
			url: '/shenye/paradise/shop/platform/detail',
			data: params
		})
	}
	// 查询数字权益卡图片
	equityCardImg(equityCardId) {
		return this.get({
			url: `/shenye/punch/activity/getEquityCardImg/${equityCardId}`
		})
	}
	
	//2023-3-21
	 // H5 盲盒首页 我的奖品 盲盒订单
	 getMyBoxOrderList(data) {
	 	return this.get({
	 		url: `/box/activity/getMyBoxOrderList`,
			data
	 	})
	 }
	 // 查询 历史活动
	 getAllHistoryBoxActivityList() {
	 	return this.get({
	 		url: `/box/activity/getAllHistoryBoxActivityList`
	 	})
	 }
	 // 盲盒商品详情
	 getBoxPrizeInfo(data) {
	 	return this.get({
	 		url: `/box/activity/getBoxPrizeInfo`,
			data
	 	})
	 }
	 // 查询神椰app版本信息详情
	 getAllHistoryBoxActivityList() {
	 	return this.get({
	 		url: `/box/activity/getAllHistoryBoxActivityList`
	 	})
	 }
	 // 商家数字权益卡用户支付
     paradiseShopNfrPay(params) {
        return this.post({
            // url: '/shenye/paradise/shop/nfr/pay',
            url: '/merchant/equity/order/shop/nfr/pay',
			type:1,
            data: params
        })
     }
    //查询非购买权益卡详情
    equityCardNotBuyDetail(id) {
        return this.get({
            url: `/equityManager/equityCard/not/buy/detail/${id}`
        })
    }
	// 微信授权登录
	customerLoginWx(data) {
	    return this.post({
	        url: '/app/v1/customer/login/wx',
			data
	    })
	}
	
	// 神椰商圈打卡支付
	punchActivityOrder(params) {
	   return this.post({
	       url: '/shenye/trade/punch/activity/order/pay',
			type:1,
	       data: params
	   })
	}
	
	// 查询神椰商圈打卡支付结果
	punchActivityResult(orderId) {
		return this.get({
			url: `/shenye/trade/punch/activity/order/pay/result/${orderId}`
		})
	}
	// 短信绑定微信
	loginSmsWxBind(data) {
		return this.post({
			url: '/app/v1/customer/login/sms/wx/bind',
			data
		})
	}
    // 短信绑定微信
	shenyeChannel(data){
		return this.get({
			url: '/common/v1/shenye/channel',
			data
		})
	}
	// 短信绑定微信
	appLoginWxMina(data){
		return this.post({
			url: '/app/v1/customer/login/wx/mina',
			data
		})
	}
}
	
const cnodeModel = new Cnode()
export default cnodeModel
